﻿<%@ Page Title="" Language="C#" MasterPageFile="~/_page.Master" AutoEventWireup="true" CodeBehind="Org-Employee-Assign.aspx.cs" Inherits="SmartSpace.WebApp.Modules.Orgs.Pages.Org_Employee_Assign" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHead" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentBody" runat="server">
    <div class="ss-tbar">
        <asp:LinkButton runat="server" ID="link_Save" Text="保存" OnClientClick="return GetEmployees()" OnClick="link_Save_Click"></asp:LinkButton>
        <asp:LinkButton runat="server" ID="LinkButton1" Text="返回" OnClick="LinkButton1_Click"></asp:LinkButton>
    </div>
    <table class="ss-list" id="tab_employee" style="width: 100%">
        <tr>
            <th>
                <input type="checkbox" id="checkAll" /></th>
            <th>Name</th>
            <th>Code</th>
        </tr>
        <asp:Repeater ID="rep1" runat="server">
            <ItemTemplate>
                <tr>
                    <td style="text-align: center">
                        <input type="checkbox" name="checkone" tag='<%# Eval("Id") %>' /></td>
                    <td style="text-align: center"><%# Eval("NameCN") %></td>
                    <td style="text-align: center"><%# Eval("Code") %></td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
    <asp:HiddenField runat="server" ID="HDEmployeeIds" ClientIDMode="Static" />
    <script type="text/javascript">
        function GetEmployees() {
            var ids = "";
            $("#tab_employee input[type=checkbox][name=checkone]").each(function () {
                if (this.checked) {
                    ids += $(this).attr("tag") + ",";
                }
            })
            if (ids == "") {
                return false;
            }
            ids = ids.substring(0, ids.lastIndexOf(','));
            $("#HDEmployeeIds").val(ids);
            return true;
        }
    </script>
</asp:Content>
